import {
  _post,
  _get,
  _put
} from '../request';
// 获取商品列表
export function getGoodsList(data) {
  return _post({
    url: `crm/pt/products/action/list-page`,
    data,
  });
}
// 新增商品
export const addGoods = (data) => {
  return _post({
    url: `crm/pt/products/action/create`,
    data,
  });
};
// 商品操作
export const editGoods = (data) => {
  return _put({
    url: `crm/pt/products/action/operator`,
    data,
  });
};

// 商品编辑
export const updateGoods = (data) => {
  return _put({
    url: `crm/pt/products/action/update`,
    data,
  });
};
// 获取商品
export const getGoods = (data) => {
  return _get({
    url: `crm/pt/products/action/detail`,
    data,
  });
};
// 上传
export const uploadFile = (data) => {
  return _post({
    url: `fileserver/pt/fileserver/action/upload`,
    data,
  });
};

//下单
export const createOrder = (data) => {
  return _post({
    url: `crm/pt/agent-orders/action/create`,
    data,
  });
};
//预检查下单
export const checkCreateOrder = (data) => {
  return _post({
    url: `crm/pt/agent-orders/action/prepareCreateCheck`,
    data,
  });
};